![]() |
RemoveResource |
||||
Header: | Resources.h | Carbon status: | Supported | |
Removes a resource’s entry from the current resource file’s resource map in memory.
void RemoveResource ( Handle theResource );
A handle to the resource which you wish to detach. If the resProtected attribute for the resource is set or if this parameter doesn’t contain a handle to a resource, the function does nothing, and the ResError function returns the result code rmvResFailed.
This function doesn’t immediately release the memory occupied by the resource data; instead, the Resource Manager releases the memory when your application quits, when you call the UpdateResFile function, or when you call the CloseResFile function.
If you’ve removed a resource, the Resource Manager writes the entire resource map when it updates the resource fork, and all changes made to the resource map become permanent. If you want any of the changes to be temporary, you should restore the original information before the Resource Manager updates the resource fork.
The RemoveResource function is also available as the RmveResource function.
If you want to release the memory before updating or closing the resource fork, call the Memory Manager function DisposeHandle after you call RemoveResource.
This function may move or purge memory blocks in the application heap. Your application should not call this function at interrupt time.
Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)